pkgname=linkbench
pkgver=git
pkgrel=1
arch=(i386 x86_64)
url="https://github.com/facebookarchive/linkbench"
license=(Apache License)
depends=('')
makedepends_debian_11=(maven)
source=('https://github.com/facebookarchive/linkbench.git')
md5sums=('SKIP')

build()
{
    cd "$srcdir/$pkgname" || return
    if [ $os == "openeuler" ]; then
        sed -i 's/5.1.22/8.0.16/' pom.xml
    fi
    mvn clean package -DskipTests || {
        echo -e "\e[31msetup network proxy please refer to https://maven.apache.org/guides/mini/guide-proxies.html\e[0m" >&2
        echo

        return 1
    }
}

package()
{
    mkdir -p "$pkgdir/lkp/benchmarks/linkbench"
    cp -af "$srcdir/$pkgname/" "/$pkgdir/lkp/benchmarks/"
}
